#include "ota_http_curl.h"
#include <stdio.h>
#include <stdlib.h>

#define TEST_URL "http://192.168.11.1:8000/fileinfo.json"
#define TEST_DOWNLOAD_URL "http://192.168.11.1:8000/download/gateway"
#define TEST_DOWNLOAD_LOCALPATH "/home/atguigu/gateway_0423/gateway"

int main(int argc, char const *argv[])
{
    response_body_t *response_body=  ota_http_curl_get_string(TEST_URL);
    if(response_body!=NULL)
    {
        printf("response_body->str:%s\n", response_body->str);
        free(response_body->str);
       free(response_body);
    }
    else{
        printf("response_body is null\n");
    }
    
   int ret=  ota_http_curl_downloadFile(TEST_DOWNLOAD_URL, TEST_DOWNLOAD_LOCALPATH);
    if(ret==0)
    {
        printf("download success\n");
    }

    return 0;
}

